#!/usr/bin/env thrift

from hello import Hello
from hello.ttypes import *

from thrift import Thrift
from thrift.transport import TSocket
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol

try:
	transport = TSocket.TSocket("localhost", 9090)
	transport = TTransport.TBufferedTransport(transport)
	protocol = TBinaryProtocol.TBinaryProtocol(transport)

	client = Hello.Client(protocol)
	transport.open()
	print client.say("world")
	transport.close()
except Thrift.TException, ex:
	print "ex:%s"%(ex.message)
